package com.ruoyi.quartz.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.quartz.mapper.UserbalanceMapper;
import com.ruoyi.quartz.domain.Userbalance;
import com.ruoyi.quartz.service.IUserbalanceService;

/**
 * UserbalanceService业务层处理
 * 
 * @author SYF
 * @date 2025-06-11
 */
@Service
public class UserbalanceServiceImpl implements IUserbalanceService 
{
    @Autowired
    private UserbalanceMapper userbalanceMapper;

    /**
     * 查询Userbalance
     * 
     * @param uid Userbalance主键
     * @return Userbalance
     */
    @Override
    public Userbalance selectUserbalanceByUid(String uid)
    {
        return userbalanceMapper.selectUserbalanceByUid(uid);
    }

    /**
     * 查询Userbalance列表
     * 
     * @param userbalance Userbalance
     * @return Userbalance
     */
    @Override
    public List<Userbalance> selectUserbalanceList(Userbalance userbalance)
    {
        return userbalanceMapper.selectUserbalanceList(userbalance);
    }

    /**
     * 新增Userbalance
     * 
     * @param userbalance Userbalance
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertUserbalance(Userbalance userbalance)
    {
        return userbalanceMapper.insertUserbalance(userbalance);
    }

    /**
     * 修改Userbalance
     * 
     * @param userbalance Userbalance
     * @return 结果
     */
    @Override
    public int updateUserbalance(Userbalance userbalance)
    {
        return userbalanceMapper.updateUserbalance(userbalance);
    }

    /**
     * 批量删除Userbalance
     * 
     * @param uids 需要删除的Userbalance主键
     * @return 结果
     */
    @Override
    public int deleteUserbalanceByUids(String[] uids)
    {
        return userbalanceMapper.deleteUserbalanceByUids(uids);
    }

    /**
     * 删除Userbalance信息
     * 
     * @param uid Userbalance主键
     * @return 结果
     */
    @Override
    public int deleteUserbalanceByUid(String uid) {
        return userbalanceMapper.deleteUserbalanceByUid(uid);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteUserbalance(){
        return userbalanceMapper.deleteUserbalance();
    }
}
